import request from "../utils/request";

export function fetchListArticle(params) {
  return request({
    url: '/p/ams/article/articleList',
    method: 'get',
    params: params
  })
}

export function addArticle(params) {
  return request({
    url: '/ams/article/addArticle',
    method: 'post',
    data: params,
    contentType: "multipart/form-data",
    processData: false
  })
}


export function deleteArticle(id, data) {
  return request({
    url: '/ams/article/deleteArticle/' + id,
    method: 'get',
    params: data
  })
}

export function deleteArticleBatch(batchId) {
  return request({
    url: '/ams/article/deleteArticleBatch/',
    method: 'post',
    data: batchId
  })
}

export function detailsArticle(id, data) {
  return request({
    url: '/p/ams/article/detail/' + id,
    method: 'get',
    params: data
  })
}

export function updatedArticle(id, params) {
  return request({
    url: '/ams/article/updateArticle/' + id,
    method: 'post',
    data: params,
    contentType: "multipart/form-data",
    processData: false
  })
}

export function getArticle(id) {
  return request({
    url: '/p/ams/article/' + id,
    method: 'get',
  })
}
